<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
{insert name="module_cssjs" css="core.css" js="jquery.min.js;jquery.area.js"}
</head>
{literal}
<style>
.selectInput {
    border: 1px solid #B9B9B9;
    padding: 5px 3px;
    width: 100px;
	vertical-align:middle;
}
.textarea {
	width: 100%;
}
.textarea1 {
	width: 500px;
	font-size: 12px;
}
</style>
<script type="text/javascript">
$(document).ready(function() {

$('[name="add-form"]').submit(function() {
	var name = $('input[name="name"]').val();
	if(!name) {
		alert('请输入景点名称'); return false;
	}
	var params = $('[name="add-form"]').serialize();
	$.post('/yunying/product/add.json', params, function(dt) {
		if(dt.status) {
			alert(dt.message);
		} else {
			alert('添加景点成功');
			window.location.href = '/yunying/product/';
		}
	}, 'json')
	return false;
});

$('[name="edit-form"]').submit(function() {
	var id = $('input[name="id"]').val();
	if(!id) {
		alert('未知景点'); return false;
	}
	var name = $('input[name="name"]').val();
	if(!name) {
		alert('请输入景点名称'); return false;
	}
	var params = $('[name="edit-form"]').serialize();
	$.post('/yunying/product/edit.json', params, function(dt) {
		if(dt.status) {
			alert(dt.message);
		} else {
			alert('编辑景点成功');
			window.location.href = '/yunying/product/';
		}
	}, 'json')
	return false;
});
})
</script>
{/literal}
<body>
<h3 class="label">
	{if $act == 'edit'}
	{include file="module/module_ticket.html" flag = "edit" id=$info.id}
	<!-- 
	<strong class="on"><span>编辑景点</span></strong>
	<span class="refresh"><a href="javascript:history.go(-1);">返回</a></span>
	 -->
	{else}
	<strong><span><a href="/yunying/product/">所有景点</a></span></strong>
	<strong class="on"><span>添加景点</span></strong>
	{/if}
	<span class="refresh"><a href="">刷新</a></span>
</h3>
<div class="table">
	<form {if $act == 'edit'}name="edit-form"{else}name="add-form"{/if} action="post">
	{if $act == 'edit'}<input name="id" type="hidden" value="{$info.id}" />{/if}
	<table class="TB-form">
		<tr>
			<td width="80">景点名称：</td>
			<td><input class="input" name="name" value="{$info.name}" /></td>
		</tr>
		<tr>
			<td width="80">所属分类：</td>
			<td>
				<select class="select" name="cid">
				<option value="0">请选择分类</option>
				{html_options options=$category selected=$info.cid}
				</select>
			</td>
		</tr>
		<tr>
			<td width="80">景点地址：</td>
			<td>
				<select class="selectInput" name="province" id="province">
					<option value="{$info.province}"></option>
				</select>
				<select class="selectInput" name="city" id="city">
					<option value="{$info.city}"></option>
				</select>
				{literal}<script type="text/javascript">$.provinceCity('province', 'city');</script>{/literal}
				<input class="input" name="location" value="{$info.name}" /></td>
		</tr>
		<tr>
			<td width="80">交通信息：</td>
			<td>
				<textarea class="textarea1" name="jiaotong">{$info.jiaotong}</textarea>
			</td>
		</tr>
		<tr>
			<td width="80">购票须知：</td>
			<td>
				<textarea class="textarea1" name="xuzhi">{$info.xuzhi}</textarea>
			</td>
		</tr>
		<tr>
			<td width="80">景点介绍：</td>
			<td>
				<textarea class="textarea" name="description">{$info.description}</textarea>
				{include file="module/module_editor.html" opts="" name="description"}
			</td>
		</tr>
	</table>
	<div class="btn-box">
		<span class="btn-indent"><input class="btn" type="submit" value="保&nbsp;&nbsp;存" /></span>
		<span class="btn-indent"><input class="btn" type="reset" value="重&nbsp;&nbsp;置" /></span>
	</div>
	</form>
</div>

</body>
</html>